import com.sun.scenario.effect.impl.sw.java.JSWBlend_SRC_OUTPeer;

import java.util.Scanner;

public class Find implements func{
    public void work(BookList bookList){
        System.out.println("查找图书");
        System.out.println("输入查找的书名");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        int size = bookList.getSize();
        for(int i = 0 ; i < size; i++) {
            if(name.equals(bookList.books[i].getName())){
                System.out.println("查找成功");
                System.out.println(bookList.books[i]);
                return;
            }
        }
        System.out.println("不存在此书");

    }
}
